<div id="view-panel" style="width:1058px; height:588px; margin-left:30px;">
  <div class="fLeft rel" style="margin-right:15px;">
    <div style="width:618px; height:551px; background-color:#fff;">
<?php
$i = 0;
foreach ($data as $p): ?>
    <div class="product" style="width:294px;">
      <div style="height:205px; background:url(<?php e($this->base); ?>/img/products/<?php e($p['Product']['thumbnail']); ?>) center center no-repeat;"></div>
      <div style="text-align:center; color:#58595B;">
        <div class="thumbTitle" style="margin-top:2px; width:100%; height:15px; overflow:hidden;"><?php e($p['Product']['name']); ?></div>
        <div class="thumbTitle" style="margin:3px 0 5px;">RM<?php e($p['Product']['price']); ?></div>
        <a href="<?php e($this->base); ?>/products/addcart/<?php e($p['Product']['id']); ?>/<?php e($page); ?>"><img src="<?php e($this->base); ?>/img/add2cart.png" border="0" /></a>
      </div>
    </div>
<?php endforeach; ?>
    </div>
    <div id="goprev" class="abs navPrev" style="left:0;"><?php echo $paginator->prev(__('PREVIOUS PAGE', true), array(), null, array('class'=>'hide')); ?></div>
    <div id="gonext" class="abs navNext" style="right:16px;"><?php echo $paginator->next(__('NEXT PAGE', true), array(), null, array('class'=>'hide')); ?></div>
  </div>
  <div class="fLeft">
    <div style="width:256px; height:501px; overflow:auto; background-color:#B0B5B6;">
      <div id="shoppingcart-title">
<?php if (is_array($cart) && count($cart)>0) { ?>
      <span style="float:right !important; font-family: Georgia,Times New Roman,Times,serif;">(<?php e(count($cart)); ?> items)</span>
<?php } ?>
      <h2><?php __('Shopping Cart'); ?></h2>
    </div>
    <div id="shoppingcart-content">
<?php if (is_array($cart) && count($cart)>0) { ?>
<?php     $total = 0;
          foreach ($cart as $c) {
              $total += $c['total']; ?>
      <div style="border-bottom:1px solid #D8DADB;">
        <div class="fLeft" style="margin-right:-66px; width:58px; height:58px;"><img src="<?php e($this->base); ?>/img/products/<?php e($c['thumb']); ?>" width="56" height="56" /></div>
        <div style="padding:6px 3px 6px 0; margin-left:66px; height:45px;">
            <form method="post" action="<?php e($this->base); ?>/pages/deleteCart">
              <input type="hidden" name="id" value="<?php e($c['id']); ?>" />
              <input type="hidden" name="page" value="<?php e($page); ?>" />
              <input type="submit" name="delete" value="" class="link" style="width:21px; height:20px; border:0; float:right; background:url(<?php e($this->base) ?>/img/remove.gif) no-repeat;">
            </form>
            <div style="margin-bottom:6px;"><?php e($c['name']); ?></div>
            <b><?php e($c['qty']); ?></b> x <span class="price">$<?php e(number_format($c['price'], 2)); ?></span>
        </div>
      </div>
<?php     } ?>
<?php } else { ?>
      <div style="padding:6px 10px;"><?php __('You have no items in your shopping cart.'); ?></div>
<?php } ?>
      </div>
    </div>
    <div class="actions" style="width:242px; background-color:#B0B5B6; padding:8px 4px 12px 10px; height:30px; color:#1B1F22;">
<?php if (is_array($cart) && count($cart)>0) { ?>
      <img title="Checkout" alt="Checkout" src="<?php e($this->base) ?>/img/checkout.png" align="right" class="link" onclick="checkout()" style="margin-right:8px;" />
      <?php __('Cart Subtotal:'); ?><div style="font-size:14px; font-weight:bold;">$<?php e(number_format($total, 2)); ?></div>
<?php } ?>
    </div>
  </div>
  <div class="clear"></div>
</div>

<script type="text/javascript">
var _webroot = '<?php e($this->base); ?>';
function init () {
                  // bc tb <-  ->  del  0  1  2  3  4  5  6  7  8  9   0  1  2  3   4   5   6   7   8   9
    var validCode = [8, 9, 37, 39, 46, 48,49,50,51,52,53,54,55,56,57, 96,97,98,99,100,101,102,103,104,105];
    Ext.select('input.qty', false, 'pages').on('keydown', function(e, t){
        if (validCode.indexOf(e.keyCode) == -1) {
            e.stopEvent();
        }
    });
} // init

function check (id) {
    var qty = Ext.fly('qty_'+id).getValue();

    if (qty < 1) {
        alert('You have enter an invalid quantity!');
        Ext.fly('qty_'+id).dom.value = '';
        Ext.fly('qty_'+id).focus();
        return false;
    }

    return true;
} // check

function shopping () {
    document.location = _webroot+'/products/condom';
} // shopping

function checkout () {
    document.location = _webroot+'/members/shipping';
} // checkout
<?php $this->addScript('Ext.onReady(function() { init(); });'); ?>
</script>